Focused on Learning logo

Glossary icon MOODLE GLOSSARY - XML CONVERTER

IN A NUTSHELL...

Create a spreadsheet with at least 2 columns:

Optional: you can add also columns for 'Category' and 'Keywords' as indicated below.

Add your entries to the spreadsheet and when you're done, copy and paste it into the box below. Click on "Convert to XML" and copy the output to a text file. Import that text file to your Moodle Glossary, and your entries will be created.

Make sure you read the notes below!

Original tab-delimited text from Excel

Copy and paste from Excel / Numbers

Columns - 1st: Concept, 2nd: Definition
3rd (optional): Category, 4th (optional): Keywords

ADVANCED SETTINGS


Multiple Categories/Keywords (see note 1 below)

Automatically link glossary entries (see note 2 below)

Automatically link categories (see note 3 below)

Entries are case sensitive (see note 4 below)

Match whole words only (see note 5 below)

Excel multi-line definition (see note 7 below)

Swap Concept and Definition

Output XML Code

Make sure you read the notes below!


Notes:

  1. You can have multiple categories and/or keywords for each entry. Just make sure that each category or keyword is separated by commas, and make sure you tick the box in the Advanced Settings.
  2. Automatically link glossary entries: If site-wide glossary auto-linking has been enabled by an administrator and this checkbox is ticked, the entry will be automatically linked wherever the concept words and phrases appear throughout the rest of the course. By default, this setting is ticked in the Advanced Settings. Ticking or unticking this box affects all entries. If you want to change individual entries, change the appropriate USEDYNALINK settings in the XML output box to 0 (entry is not linked) or 1 (entry is linked). Also have a look at the section on the Auto-Linking Filter below.
  3. Automatically link categories: If glossary auto-linking has been enabled and this setting is enabled, the category name will be automatically linked wherever it appears throughout the rest of the course. When a participant follows a category name link, they will be taken to the "Browse by category" page of the glossary. By default, this setting is unticked in the Advanced Settings. Ticking or unticking this box affects all categories. If you want to change individual categories, change the appropriate USEDYNALINK settings in the XML output box to 0 (category is not linked) or 1 (category is linked).
  4. Entries are case sensitive: This setting specifies whether matching exact upper and lower case is necessary when auto-linking to an entry. By default, this setting is unticked in the Advanced Settings. Ticking the box will affect ALL entries. If you want to change individual entries or categories, change the appropriate CASESENSITIVE settings in the XML output box to 0 (entry is not case sensitive) or 1 (entry is case sensitive).
  5. Match whole words only: This setting specifies whether only whole words will be linked, for example, a glossary entry named "construct" will not create a link inside the word "constructivism". By default, this setting is ticked in the Advanced Settings, so only whole words will be linked. Unticking the box will affect ALL entries. If you want to change individual entries or categories, change the appropriate FULLMATCH settings in the XML output box to 0 (whole word matching is ignored) or 1 (only whole words will be linked).
  6. The default display format for the Glossary is 'dictionary'. You can change DISPLAYFORMAT in the XML output box to any of the following: continuous, dictionary, encyclopedia, entrylist, faq, fullwithauthor, fullwithoutauthor. Alternatively, you can edit the Glossary settings when it is imported into Moodle. You will find information about the current formats at https://docs.moodle.org/en/Glossary_settings#Display_format
  7. Excel multi-line definition: If your definition has text in multiple lines, make sure you tick the box in the Advanced Settings - otherwise each line will be created as a separate concept! The script assumes you have multiple lines only in definitions (not in concepts).
  8. Swap Concept and Definition: This setting comes in handy for creating a reverse lookup glossary.
  9. HTML tags will be converted to HTML entities.

Using the Glossary Auto-Linking Filter

The Glossary Auto-Linking Filter creates links to a glossary activity entry whenever the word or phrase is used elsewhere in course, such as in forum posts, labels or page resources.

The filter must be enabled by an administrator in Site administration > Plugins > Filters. A teacher can then turn the filter on (or off) in the course or in a particular activity via the Filters link in the administration block.

Note: Enabling the filter does not automatically turn on linking for each glossary entry. In the glossary settings 'Automatically link glossary entries' should be set to Yes, and for each glossary entry the checkbox 'This entry should be automatically linked' should be ticked.



Disabling for specific text

Within activities and resources certain text can have the auto-linking disabled by highlighting the text in question and clicking on the 'Prevent automatic linking' button (chain with a red cross through it). Alternatively, if you are viewing the text in HTML markup mode, links can be prevented by adding <nolink>YourText</nolink> tags around the relevant content.

Another way to force autolinking on/off in HTML markup mode is to use:

<span class="link">YourText</span> (to force a link on)
<span class="nolink">YourText</span> (to force a link off)



CSS Trick

Your Moodle theme will normally show all links in the same colour, so it's sometimes difficult to distingusigh glossary autolinks from any other type of link. You can change the colour of the autolink with this CSS...

a.glossary.autolink {background: #ffff00 !important;}


And if you really want to be clever, you can target individual glossaries - so different glossaries can have different autolink colours...

.cmid-1234 a.glossary.autolink {background: #ffff00 !important;}
.cmid-5678 a.glossary.autolink {background: #ff0000 color: #ffffff !important;}


The 'cmid-xxxx' number is the idnumber of the activity - you'll find the idnumber in the URL of the glossary,
eg. http://yourmoodle/mod/glossary/view.php?id=xxxx

Information about HTML colours

Useful Links:

Focused on Learning Ltd.
www.focusedonlearning.com
@FOL_Ltd

This Glossary XML Converter is based on the excellent work started by Yasu Imao (2008)